//
//  FCollectionReusableView.m
//  YiQiTingShu
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 直到世界的尽头. All rights reserved.
//

#import "FCollectionReusableView.h"
#import "PublicHeader.h"
#import <UIImage+AFNetworking.h>

@interface FCollectionReusableView ()
@property(nonatomic, strong)UILabel *label1;
@property(nonatomic, strong)UIImageView *imageView1;
@property(nonatomic, strong)UIImageView *assistView;
@end

@implementation FCollectionReusableView

#pragma mark - 懒加载
-(UIImageView *)assistView
{
    if (!_assistView) {
        _assistView = [[UIImageView alloc] init];
        [self addSubview:_assistView];
    }
    return _assistView;
}

-(UILabel *)assistLabel
{
    if (!_assistLabel) {
        _assistLabel = [[UILabel alloc] init];
        [self addSubview:_assistLabel];
    }
    return _assistLabel;
}

-(UIImageView *)imageView1
{
    if (!_imageView1) {
        _imageView1 = [[UIImageView alloc] init];
        [self addSubview:_imageView1];
    }
    return _imageView1;
}

-(UILabel *)label1
{
    if (!_label1) {
        _label1 = [[UILabel alloc] init];
//        _label1
        [self addSubview:_label1];
    }
    return _label1;
}

-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        [_titleLabel NightWithType:UIViewColorTypeNormal];
        [self addSubview:_titleLabel];
    }
    return _titleLabel;
}

-(void)setType:(FCollectionReusableViewTypes)type
{
    _type = type;
    
    switch (type) {
        case FCollectionReusableViewTypesMore:
            self.label1.frame = CGRectMake(0, 0, self.frame.size.width, FitConstant_YorHeight(10));
            [self.label1 NightWithType:UIViewColorType3];
            
            self.titleLabel.frame = FitRectMake(30, 10, 200, 20);
            self.titleLabel.font = [UIFont systemFontOfSize:16];
            
            self.assistLabel.frame = FitRectMake(303, 10, 45, 20);
            self.assistLabel.text = @"更多";
            self.assistLabel.textAlignment = 2;
            self.assistLabel.textType = [NSNumber numberWithInteger:LabelColorGray];
            self.assistLabel.font = [UIFont systemFontOfSize:14];
            [self.assistLabel NightWithType:UIViewColorTypeNormal];
            
            self.imageView1.frame = FitRectMake(10, 13, 15, 15);
            [self.imageView1 setImage:[UIImage imageNamed:@"sanjiao"]];
            
            self.assistView.frame = FitRectMake(345, 10, 20, 20);
            [self.assistView setImage:[UIImage imageNamed:@"xiangyou"]];
            break;
        case FCollectionReusableViewTypesSearch:
            self.imageView1.frame = FitRectMake(10, 13, 15, 15);
            [self.imageView1 setImage:[UIImage imageNamed:@"sanjiao"]];
            self.titleLabel.frame = FitRectMake(30, 10, 200, 20);
            self.titleLabel.font = [UIFont systemFontOfSize:16];
            break;
            
        default:
            break;
    }
}



@end
